package refactor.mapper;

import org.apache.ibatis.annotations.Param;
import refactor.entity.EventLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 记录系统中设备设施发生的所有事件 Mapper 接口
 * </p>
 *
 * @author 杨健
 * @since 2019-08-19
 */
public interface EventLogMapper extends BaseMapper<EventLog> {
    int countAllCasualApplicationByRegionId(int regionId);

    int countAllCasualApplicationByRegionIdNotHandle(int regionId);

    boolean lotUpdate(List<EventLog> logs);

    List<Map<String, Object>> getWarningMessage(int regionId);
    // 查询最大值
    Integer max(@Param("fieldname") String fieldname);
    // 按指定字段分组统计
    List<Map<String, Integer>> statMapByFieldname(@Param("fieldname") String fieldname);
}
